package littlecyberwar.model;

import java.util.*;

import littlecyberwar.ui.*;

/**
 * This is used to hold data for a tray
 * The data us that of a HashMap of Vectors
 * The HashMap is keyed by the name of the tray
 * the value is a vector which holds all the unit element
 */
public class TrayModel {
  private HashMap hash;		// key = subtray name, val is a vector
  private Element currEl; // current selected element in the tray

  public TrayModel() {
    hash = new HashMap(1);
  }

  public Vector addNewTray( String name ) {
    Vector v = new Vector();
    hash.put(name,v);
    return ( v );
  }

  public Set getAllTrayNames() {
    return ( hash.keySet() );
  }

  public void removeTray ( String name ) {
    hash.remove(name);
  }

  public Vector getTrayByName( String name ) {
    return ( (Vector)hash.get(name) );
  }


}